import cv2
import numpy as np

# 显示一张图片
def im_show(img,name='test'): 
    """
    显示图片
    :param img:图片数据
    :param name:窗口名称
    """
    cv2.namedWindow(name, cv2.WINDOW_NORMAL)
    cv2.imshow(name,img)
    key = cv2.waitKey(0)
    while(key != 27):
        key = cv2.waitKey(0)
    cv2.destroyWindow(name)
    cv2.waitKey(1)
# 显示多张图片
def im_mul_show(**kwargs):
    """
    显示多张图片
    :key key:窗口名称
    :value value:图片数据
    """
    for key,value in kwargs.items():
        cv2.namedWindow(key, cv2.WINDOW_NORMAL)
        cv2.imshow(key,value)
    keyboard = cv2.waitKey(0)
    while(keyboard != 27):
        keyboard = cv2.waitKey(0)
    cv2.destroyAllWindows()
    cv2.waitKey(1)